package com.taoism.customEnum;

/**
 * 规则类型枚举
 *
 * @author 李嘉
 * @version 1.0
 * @Description 规则类型枚举
 * @date 2019-07-14 22:31
 */
public enum MatchTypeEnum {

    /**
     * EXCEL
     */
    EXCEL("Excel", 1),

    /**
     * WORD
     */
    WORD("Word", 2),

    /**
     * TXT
     */
    TXT("txt", 3);

    private String name;
    private int index;

    MatchTypeEnum() {
    }

    MatchTypeEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    public static String getName(int index) {
        for (MatchTypeEnum info : MatchTypeEnum.values()) {
            if (info.getIndex() == index) {
                return info.getName();
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

}
